package LianXi02;

import java.util.Scanner;

public class LianXi01 {
    public static void main(String[] args) {
        //从键盘输入本次Java考试五位学生的成绩，求考试成绩最高分
       int[] nums = new int[5];
        for (int i = 0; i < 5; i++) {
            System.out.println("请输入第"+(i+1)+"位学生的考试分数");
            Scanner scanner = new Scanner(System.in);
            nums[i] = scanner.nextInt();
        }
        for (int i = 0; i < 5; i++) {
            System.out.println(nums[i]);
        }
        int max = 0;
        for (int i = 0; i < 5; i++) {
            if (nums[i]>max){
                max = nums[i];
            }
        }
        System.out.println("最高分为："+max);

        //增强 for eatch循环
        //遍历
        for (int a:nums){
            System.out.println(a);
        }
    }
}
